#!/usr/bin/env bash

######
# 打开指定镜像的dockerhub地址
######

HUB_BAS="https://hub.docker.com"

function dc_o_main(){
    if [ $# =  0 ]; then
        log-w "Usage:dc-o imageName"
        return 1
    fi

    imageName=$1

    case $imageName in
     *.com*|*.cn*)
        log-e "Not Supported Repo"
        ;;
     *\/*)
        open $HUB_BAS"/r/"$imageName
        ;;
     *)
        open $HUB_BAS"/_/"$imageName
      ;;
    esac
}

dc_o_main $*